home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------------------------------ */
-
- /* WWW Poll Script, Version 1.1
- Copyright 1994, Creative Internet Designs
- by Joseph E. Cates and Aure Prochazka
-
- Documentation and most current version available at:
- http://www.galcit.caltech.edu/~ta/demos/wwwpoll/wwwpoll.html
-
- */
-
- #include "wwwpoll.h"
-
- /* structures for form results */
-
- typedef struct {
- char *name;
- char *val;
- } formres_entry;
-
- typedef struct {
- int nvotes;
- char name[MAX_NAME_LEN];
- } list_entry;
-
- typedef struct {
- char name[MAX_VOTER_LEN];
- } voterlog_entry;
-
-
- void wr_list(char *listname);
- void wr_htinc_file(char *listname);
- void wr_log(char *s1, char *s2);
- void load_list(char *listname);
-
- void disp_main_page(int istatus);
- void add_entry_page(char *list);
- void html_header(char *s1, char *s2);
-
- void already_got_one();
- void too_many_items();
- void bad_option_for_question();
- void bad_form_res();
-
- void err_msg(char *s1, char *s2);
- void error_footer(char *s);
- void input_err(int err_code);
-
- int include_file(char *flname);
-
- void get_host_info(char *hostinfo, int maxlength);
- void strip_end_cr(char *s);
- void strip_white(char *s);
-
- void unescape_url(char *url);
- void plus_to_space(char *s);
-
- char *makeword(char *line, char stop);
- char *fmakeword(FILE *f, char stop, int *len);
- char x2c(char *what);
-
- /* ----- global variables ----- */
- int totalnumvotes = 0, numvoterlog;
- int nquest, novoteflag = 0, nitems;
-
- char ha[MAX_VOTER_LEN], lastvoter[MAX_VOTER_LEN];
-
- char qheader[BUF_LEN], qtitle[BUF_LEN];
- char vplus_gif[BUF_LEN], vminus_gif[BUF_LEN], add_gif[BUF_LEN];
- char buf[BUF_LEN];
-
- formres_entry entries[MAX_FORM_RES];
- list_entry blist[MAX_ITEMS];
-
- voterlog_entry *vlog_ptr0;
-
- /* flags in list file to customize handling of a question
- iadd_flag - can users add entries (0 = no, ELSE = yes)
- ivplus_flag - can users vote plus (0 = no, ELSE = yes)
- ivminus_flag - can users vote minus (0 = no, ELSE = yes)
- isort_flag - sort list by vote count (0 = no, ELSE = yes)
- idcnt_flag - display vote count (0 = no, ELSE = yes)
- */
- int iadd_flag, ivplus_flag, ivminus_flag, isort_flag, idcnt_flag;
-
- int main(int argc, char *argv[]) {
-
- int cl, i, j, k, x, m=0, ivote, itmp;
- FILE *fp;
-
- char action[64], list[64], flname[256];
- char *rh_name, *rh_user;
-
- voterlog_entry *vlog_ptr1, *vlog_ptr2;
-
- /* if no argument supplied, just set action to do display main page */
- if (argc < 2) strcpy(action, "display");
- else strcpy(action, argv[1]);
-
- get_host_info(ha, MAX_VOTER_LEN-1);
-
- /* --------------------------- DISPLAY PAGE ------------------------------- */
- if (strcmp(action, "display") == 0) {
-
- wr_log(action, "");
-
- /* display the main HTML page and exit without rewriting files */
- disp_main_page(0); exit(0);
-
-
- /* ------------------------------- INIT ----------------------------------- */
- } else if (strcmp(action, "init") == 0) {
-
- wr_log(action, "");
-
- if ((fp = fopen(CFG_FILE, "r")) == NULL)
- err_msg("Error opening configuration file for reading: ", CFG_FILE);
-
- fscanf(fp, "%d\n", &nquest);
- if (nquest < 1) err_msg("Invalid number of polls in config file.", "");
-
- for (i = 0; i < nquest; i++) {
-
- fgets(list, BUF_LEN, fp); strip_end_cr(list);
- if (ferror(fp)) err_msg("Error reading config file: ", CFG_FILE);
-
- /* load the list info */
- load_list(list);
-
- /* write the HTML include file */
- wr_htinc_file(list);
-
- }
-
- fclose(fp);
-
- /* display page and exit, don't need to rewrite the list files */
- disp_main_page(0); exit(0);
-
- /* ------------------------- ADD ENTRY OR VOTE ---------------------------- */
- } else if ((strcmp(action, "vplus") == 0) || (strcmp(action, "vminus") == 0)
- || (strcmp(action, "procnew") == 0) || (strcmp(action, "add") == 0)) {
-
- /* requires 3 arguments, otherwise display page with error msg */
- if (argc != 4) { disp_main_page(1); exit(0); }
-
- /* now get the list name (doubles as file name) */
- strcpy(list, argv[2]);
-
- /* load the list info */
- load_list(list);
-
- /* ---- voting, increment or decrement the item's number votes ---- */
- if ((strcmp(action,"vplus") == 0) || (strcmp(action,"vminus") == 0)) {
-
- /* check for people guessing options that aren't allowed */
- if ((strcmp(action,"vplus") == 0) && (ivplus_flag == 0))
- bad_option_for_question();
- if ((strcmp(action,"vminus") == 0) && (ivminus_flag == 0))
- bad_option_for_question();
-
- ivote = atoi(argv[3]); /* which item */
-
- /* bad item number is probably a URL from an old poll */
- if ((ivote < 0) || (ivote > nitems-1)) { disp_main_page(1); exit(0); }
-
- /* see if the current person is on the list of last voters */
- for (vlog_ptr1=vlog_ptr0, i=0; i < numvoterlog; i++) {
- if (strcmp(ha, (char *) vlog_ptr1) == 0) novoteflag = 1;
- vlog_ptr1++;
- }
-
- if (novoteflag == 0) {
-
- wr_log(action, blist[ivote].name);
-
- /* shift list down and add latest to the end of the list */
- vlog_ptr1 = vlog_ptr2 = vlog_ptr0;
- vlog_ptr2++;
- for (i=0; i < numvoterlog-1; i++) {
- strcpy((char *) vlog_ptr1, (char *) vlog_ptr2);
- vlog_ptr1++; vlog_ptr2++;
- }
- strcpy((char *) vlog_ptr1, ha);
-
- /* save in the last voter string variable for below */
- strcpy(lastvoter, ha);
-
- totalnumvotes++;
-
- /* increment or decrement the items vote count */
- if (strcmp(action, "vplus") == 0) ++blist[ivote].nvotes;
- else --blist[ivote].nvotes;
-
- } else wr_log(action, "Error: Already Voted!");
-
- /* ---- display form for adding an entry ---- */
- } else if (strcmp(action, "add") == 0) {
-
- wr_log(action, list);
-
- /* check for people guessing options that aren't allowed */
- if (iadd_flag == 0) bad_option_for_question();
-
- /* if there are already too many items, don't let them add */
- if (nitems >= MAX_ITEMS) too_many_items("");
-
- /* build html form to input the new entry */
- add_entry_page(list);
-
- /* exit now, we don't need to rewrite any of the files */
- exit(0);
-
- /* ---- add the entry they typed in to the appropriate list ---- */
- } else if (strcmp(action, "procnew") == 0) {
-
- /* check for people guessing options that aren't allowed */
- if (iadd_flag == 0) bad_option_for_question();
-
- m = -1;
-
- if (getenv("CONTENT_LENGTH") == NULL) {
- disp_main_page(1);
- exit(0);
- } else {
- cl = atoi(getenv("CONTENT_LENGTH"));
- for (x=0; cl && (!feof(stdin));x++) {
- m=x;
- entries[x].val = fmakeword(stdin,'&',&cl);
- plus_to_space(entries[x].val);
- unescape_url(entries[x].val);
- entries[x].name = makeword(entries[x].val,'=');
- strip_white(entries[0].name);
- strip_white(entries[0].val);
- }
- }
-
- /* no forms probably means reloading after add, display page */
- if (m == -1) { disp_main_page(1); exit(0); }
-
- /* did browser return one entry with correct name */
- if ((m != 0) || (strcmp(entries[0].name, "item") != 0))
- bad_form_res();
-
- wr_log(list, entries[0].val);
-
- if (strpbrk(entries[0].val, "<>&")) input_err(1);
- if (strpbrk(entries[0].val, "\b\f\n\r\v")) input_err(2);
- if (strpbrk(entries[0].val, "\"")) input_err(3);
- if (strlen(entries[0].val) == 0) input_err(4);
-
- for (i = 0; i < nitems; i++) {
- if (strcmp(entries[0].val, blist[i].name) == 0) already_got_one();
- }
-
- /* increment the number of items count */
- nitems++;
-
- /* put value and initialize to zero vote count */
- strcpy(blist[nitems-1].name, entries[0].val);
- blist[nitems-1].nvotes = 0;
-
- }
-
- /* ------------------------- ELSE UNRECOGNIZED ---------------------------- */
- } else {
-
- /* for bad argument, display the main HTML page and exit */
- disp_main_page(-1); exit(0);
-
- }
-
-
- if (isort_flag) {
-
- /* sort the items in order of the number of votes */
- for (i = 0; i < nitems; i++) {
- for (j = i; j < nitems; j++) {
-
- if (blist[j].nvotes > blist[i].nvotes) {
-
- itmp = blist[i].nvotes;
- blist[i].nvotes = blist[j].nvotes;
- blist[j].nvotes = itmp;
-
- strcpy(buf, blist[i].name);
- strcpy(blist[i].name, blist[j].name);
- strcpy(blist[j].name, buf);
-
- }
- }
- }
-
- }
-
- /* write the existing list back to the the list file */
- wr_list(list);
-
- /* write the HTML include file */
- wr_htinc_file(list);
-
- /* redisplay the page */
- disp_main_page(0);
-
- exit(0);
-
- }
-
- /* ---------------------------------------------------------------------------
- disp_main_page: display the main poll page
- ------------------------------------------------------------------------ */
- void disp_main_page(int istatus) {
-
- int i, nquest;
- FILE *fp;
- char incflname[256];
-
- html_header("", "");
-
- if (istatus != 0) {
-
- printf(ERROR_IMG " The requested poll URL is incorrect, the URL is\n"
- "probably from an old question. The correct URL to access the\n"
- "poll is " POLL_HREF SERVER POLL_URL "</A>\n<HR>\n");
-
- } else if (novoteflag != 0) {
-
- printf(ERROR_IMG " Voter from <B>%s</B>. Your host is in the\n"
- "list of recent voters, so you can't vote again. Try another\n"
- "question!\n<HR>\n", ha);
-
- } else {
-
- #ifdef HTML_LEADIN
- printf(HTML_LEADIN);
- #endif
-
- }
-
- if ((fp = fopen(CFG_FILE, "r")) == NULL)
- err_msg("Error opening configuration file for reading: ", CFG_FILE);
-
- fscanf(fp, "%d\n", &nquest);
- if (nquest < 1) err_msg("Invalid number of polls in config file.", "");
-
- for (i = 0; i < nquest; i++) {
-
- fgets(buf, BUF_LEN, fp); strip_end_cr(buf);
- if (ferror(fp)) err_msg("Error reading config file.", CFG_FILE);
-
- /* this only works with NCSA 1.1, replaced for other versions */
- /* printf("<INC SRV \"" INC_URL_BASE "%s.htinc\">\n", buf); */
-
- /* build the filename */
- sprintf(incflname, HTINC_FILE_DIR "%s.htinc", buf);
-
- /* include the file directly from the code */
- if (include_file(incflname) != 0)
- err_msg("Error including htinc file:", incflname);
-
- printf("<HR>\n");
-
- }
-
- fclose(fp);
-
- #ifdef HTML_FOOTER
- printf(HTML_FOOTER);
- #endif
-
- printf("</BODY>\n</HTML>\n");
-
- }
-
- /* ---------------------------------------------------------------------------
- wr_htinc_file: write htinc (HTML include file) data to file
- ------------------------------------------------------------------------ */
- void wr_htinc_file(char *listname) {
-
- int i;
- char flname[256];
- FILE *fp;
-
- if ((nitems < MIN_ITEMS) || (nitems > MAX_ITEMS))
- err_msg("Invalid number of items trying to write include file.", "");
-
- /* build the filename */
- sprintf(flname, HTINC_FILE_DIR "%s.htinc", listname);
-
- if ((fp = fopen(flname, "w")) == NULL)
- err_msg("Error opening include file for writing.", flname);
-
- fprintf(fp, "%s\n%s\n", qheader, qtitle);
-
- fprintf(fp, "<DL>\n<DD>\n");
-
- for (i = 0; i < nitems; i++) {
-
- if (ivplus_flag) {
- fprintf(fp, "<A HREF=\"" POLL_URL "?vplus+%s+%d\">" VPLUS_IMG "</A>",
- listname, i, vplus_gif);
- }
-
- fprintf(fp, " ");
-
- if (ivminus_flag) {
- fprintf(fp, "<A HREF=\"" POLL_URL "?vminus+%s+%d\">" VMINUS_IMG "</A>",
- listname, i, vminus_gif);
- }
-
- if (idcnt_flag) {
- fprintf(fp, " %s (%d)<P>\n", blist[i].name, blist[i].nvotes);
- } else {
- fprintf(fp, " %s<P>\n", blist[i].name);
- }
-
- if (ferror(fp)) err_msg("Error writing to include file:", flname);
-
- }
-
- /* only display add button if user's can add to the list */
- if (iadd_flag) {
- fprintf(fp, "<A HREF=\"" POLL_URL "?add+%s+0\">" ADD_IMG "</A>\n",
- listname, add_gif);
- }
-
- fprintf(fp, "</DD>\n");
- fprintf(fp, "<P>\n<DT>Total votes: %d, Last vote from: %s</DT>\n",
- totalnumvotes, lastvoter);
- fprintf(fp, "</DL>\n");
-
- fclose(fp);
-
- }
-
- /* ---------------------------------------------------------------------------
- add_entry_page: display the form to add an entry
- ------------------------------------------------------------------------ */
- void add_entry_page(char *list) {
-
- int i;
-
- html_header(": Add Entry", "");
-
- printf("The current entries for this question are:\n<P>\n");
- printf("%s\n<UL>\n", qtitle);
-
- for (i = 0; i < nitems; i++) {
- printf("<LI>%s (%d)\n</LI>", blist[i].name, blist[i].nvotes);
- }
-
- printf("</UL>\n<HR>\n");
-
- printf("<FORM METHOD=\"POST\" ACTION=\"" POLL_URL "?procnew+%s+0\">\n",
- list);
-
- printf("<B>Enter Item Name:</B><BR>\n"
- "<INPUT TYPE=\"text\" NAME=\"item\" SIZE=52 MAXLENGTH=%d>\n<P>\n",
- MAX_NAME_LEN-2);
-
- printf("<P>\n<INPUT TYPE=\"submit\" VALUE=\" SUBMIT THE NEW ITEM \">\n"
- "</FORM>\n");
-
- printf("<HR>\n<B>\n" POLL_HREF BACK_IMG "</A>\n"
- "Quit Back to " POLL_HREF TITLE "</A>\n</B>\n");
-
- }
-
- /* ---------------------------------------------------------------------------
- html_header: header for html pages
- ------------------------------------------------------------------------ */
- void html_header(char *s1, char *s2) {
-
- printf("Content-type: text/html\n\n");
-
- printf("<HTML>\n<HEAD>\n");
- printf("<TITLE>" TITLE "%s %s</TITLE>\n", s1, s2);
- printf("</HEAD>\n<BODY>\n");
- printf("<H2>" TITLE "%s %s</H2>\n<HR>", s1, s2);
-
- }
-
- /* ---------------------------------------------------------------------------
- load_list: load list data from file
- ------------------------------------------------------------------------ */
- void load_list(char *listname) {
-
- int i;
- char flname[128];
- FILE *fp;
- voterlog_entry *vlog_ptr;
-
- /* build the filename */
- sprintf(flname, LIST_FILE_DIR "%s.list", listname);
-
- /* open file for reading */
- fp = fopen(flname, "r");
-
- /* file not found probably means an old poll URL, so just display */
- if (fp == NULL) { disp_main_page(1); exit(0); }
-
- fgets(qheader, BUF_LEN, fp); strip_end_cr(qheader);
- if (ferror(fp)) err_msg("Error reading list input file: ", flname);
-
- fgets(qtitle, BUF_LEN, fp); strip_end_cr(qtitle);
- if (ferror(fp)) err_msg("Error reading list input file: ", flname);
-
- fscanf(fp, "%d\n%d\n%d\n%d\n%d\n", &iadd_flag, &ivplus_flag,
- &ivminus_flag, &isort_flag, &idcnt_flag);
-
- fgets(vplus_gif, BUF_LEN, fp); strip_end_cr(vplus_gif);
- fgets(vminus_gif, BUF_LEN, fp); strip_end_cr(vminus_gif);
- fgets(add_gif, BUF_LEN, fp); strip_end_cr(add_gif);
-
- fscanf(fp, "%d\n", &nitems);
- if ((nitems < MIN_ITEMS) || (nitems > MAX_ITEMS))
- err_msg("Invalid number of items in list input file: ", flname);
-
- if (ferror(fp)) err_msg("Error reading info from list file: ", flname);
- if (feof(fp)) err_msg("End of file reading info from list file: ", flname);
-
- for (i = 0; i < nitems; i++) {
-
- fscanf(fp, "%d\n", &blist[i].nvotes);
-
- fgets(blist[i].name, MAX_NAME_LEN, fp);
- strip_end_cr(blist[i].name);
-
- if (ferror(fp)) err_msg("Error reading items from list file: ", flname);
- if (feof(fp)) err_msg("End of file reading items from list file: ", flname);
-
- }
-
- fscanf(fp, "%d\n", &totalnumvotes);
-
- /* number of voters to log */
- fscanf(fp, "%d\n", &numvoterlog);
-
- if (numvoterlog > 0) {
-
- /* allocate memory for the list of voters */
- if ((vlog_ptr0 = malloc(numvoterlog * MAX_VOTER_LEN)) == NULL)
- err_msg("Error attempting to allocate memory for voter log.", "");
-
- for (vlog_ptr=vlog_ptr0, i=0; i < numvoterlog; i++) {
-
- /* get the last persons to vote */
- fgets((char *) vlog_ptr, BUF_LEN, fp); strip_end_cr((char *) vlog_ptr);
-
- /* save last voter in a normal string variable */
- strcpy(lastvoter, (char *) vlog_ptr);
-
- /* increment to the next voter slot */
- vlog_ptr++;
-
- if (ferror(fp)) err_msg("Error reading voters from list file: ", flname);
- if (feof(fp)) err_msg("End of file reading voters from list file: ", flname);
-
- }
- }
-
- fclose(fp);
-
- }
-
- /* ---------------------------------------------------------------------------
- wr_list: write list data to file
- ------------------------------------------------------------------------ */
- void wr_list(char *listname) {
-
- char flname[128];
- FILE *fp;
- int i;
- voterlog_entry *vlog_ptr;
-
- if ((nitems < MIN_ITEMS) || (nitems > MAX_ITEMS))
- err_msg("Invalid number of items trying to write list file.", "");
-
- /* build the filename */
- sprintf(flname, LIST_FILE_DIR "%s.list", listname);
-
- if ((fp = fopen(flname, "w")) == NULL)
- err_msg("Error opening list file for writing:", flname);
-
- fprintf(fp, "%s\n%s\n", qheader, qtitle);
- fprintf(fp, "%d\n%d\n%d\n%d\n%d\n", iadd_flag, ivplus_flag,
- ivminus_flag, isort_flag, idcnt_flag);
-
- fprintf(fp, "%s\n%s\n%s\n", vplus_gif, vminus_gif, add_gif);
-
- fprintf(fp, "%d\n", nitems);
- for (i = 0; i < nitems; i++) {
- fprintf(fp, "%d\n%s\n", blist[i].nvotes, blist[i].name);
- if (ferror(fp)) err_msg("Error writing items to list file: ", flname);
- }
-
- fprintf(fp, "%d\n", totalnumvotes);
-
- fprintf(fp, "%d\n", numvoterlog);
- for (vlog_ptr=vlog_ptr0, i=0; i < numvoterlog; i++) {
- fprintf(fp, "%s\n", (char *) vlog_ptr);
- vlog_ptr++;
- }
-
- fprintf(fp, "\n");
-
- fclose(fp);
-
- }
-
- /* ----------------------------------------------------------------------
- wr_log: write info to the log file
- ------------------------------------------------------------------- */
- void wr_log(char *s1, char *s2) {
-
- char dstr[128];
- FILE *fp_log;
- struct tm *ptr;
- time_t lt;
-
- /* ...generate date to put in the error log... */
- lt = time(NULL);
- ptr = localtime(<);
- strftime(dstr, 40, "%B %d, %Y at %H:%M:%S", ptr);
-
- fp_log = fopen(LOG_FILE, "a");
-
- if (fp_log != NULL) {
- fprintf(fp_log, "%s, %s, %s %s\n", ha, dstr, s1, s2);
- }
-
- fclose(fp_log);
-
- }
-
- /* ---------------------------------------------------------------------------
- bad_form_res: bad form results returned by their browser
- ------------------------------------------------------------------------ */
- void bad_form_res() {
-
- html_header(": Form Input Error", "");
-
- printf("The form results were returned incorrectly by your browser.\n"
- "Your browser may not correctly support the form elements (TEXT and\n"
- "RADIO) used in this application\n<P>\n");
-
- printf("If you would like to report the problem, send e-mail to the\n"
- "maintainers of the " TITLE " at <I>" E_MAIL "</I>.\n");
-
- error_footer(""); exit(0);
-
- }
-
- /* ---------------------------------------------------------------------------
- err_msg: error messages page for errors NOT caused by user input
- ------------------------------------------------------------------------ */
- void err_msg(char *s1, char *s2) {
-
- html_header(": Fatal Script Error", "");
-
- printf("An error occurred in the " TITLE " script. Please report\n"
- "this problem to the maintainers of the " TITLE " at <I>"
- E_MAIL "</I>. Thank you.\n<P>\n");
-
- printf("Error Message: <TT><B>%s%s</B></TT>\n<P>\n", s1, s2);
-
- printf("Any data entered may still be available from your viewer\n"
- "by using BACK to return to the previous form.\n");
-
- error_footer(""); exit(1);
-
- }
-
- /* ---------------------------------------------------------------------------
- input_err: error messages caused by user input
- ------------------------------------------------------------------------ */
- void input_err(int err_code) {
-
- html_header(": Input Error", "");
-
- printf(ERROR_IMG " ");
-
- if (err_code == 1) {
-
- printf("Text input fields are not allowed to contain HTML tags or\n"
- "the <code><</code>, <code>></code>, or <code>&</code>\n"
- "characters.\n");
-
- } else if (err_code == 2) {
-
- printf("Text input fields are not allowed to contain carriage\n"
- "returns, new line, backspace, form feed, or vertical tab codes.\n"
- "(In fact, we don't know how you managed to get one in there\n"
- "anyway.)\n");
-
- } else if (err_code == 3) {
-
- printf("At present, text input fields are not allowed to contain\n"
- "double quotes (\"). This is because no uniform method exists\n"
- "of marking the double quotes in forms that works with all\n"
- "viewers. Single quotes may, however, be freely used.\n");
-
- } else if (err_code == 4) {
-
- printf("Null input fields found. To add an item to the " TITLE ",\n"
- "all fields must contain an entry after leading and trailing\n"
- "spaces are removed.\n");
-
- } else {
-
- printf("Unidentified text input error.\n");
-
- }
-
- printf("Please correct and resubmit the text.\n<P>\n");
-
- printf("The data entered may still be available from your viewer\n"
- "by using BACK to return to the previous form.\n");
-
- error_footer(""); exit(0);
-
- }
-
-
- /* ----------------------------------------------------------------------
- already_got_one: aleady have the same URL in the list
- ------------------------------------------------------------------- */
- void already_got_one() {
-
- html_header(": Already Got One", "");
-
- printf(ERROR_IMG " Sorry, the specified item is already in the\n"
- "list. Please choose another item to add.\n");
-
- error_footer(""); exit(0);
-
- }
-
- /* ----------------------------------------------------------------------
- bad_option_for_question: bad option (vplus, vminus, add) for question
- ------------------------------------------------------------------- */
- void bad_option_for_question() {
-
- html_header(": Bad Option for Question", "");
-
- printf(ERROR_IMG " The option chosen is not available on the\n"
- "current question. In fact, we don't know how you got this\n"
- "error message to appear? (Are you trying to guess a new\n"
- "URL?)\n");
-
- error_footer(""); exit(0);
-
- }
-
- /* ----------------------------------------------------------------------
- too_many_items: too many items in list
- ------------------------------------------------------------------- */
- void too_many_items() {
-
- html_header(": Too Many Items", "");
-
- printf(ERROR_IMG " The maximum number of items allowed (%d) has\n"
- "been reached. Sorry, no new items can be added.\n", MAX_ITEMS);
-
- error_footer(""); exit(0);
-
- }
-
- /* ----------------------------------------------------------------------
- error_footer: footer for all error screens
- ------------------------------------------------------------------- */
- void error_footer(char *s) {
-
- printf("<HR>\n<B>\n" POLL_HREF BACK_IMG "</A>\n"
- "Quit Back to " POLL_HREF TITLE "</A>\n</B>\n");
-
- }
-
- /* end */
-
-
-